package org.feiye.studyday24;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class WriteFileTest {
	// 字节输出流
	public static void main(String[] args) {
		OutputStream o = null;
		try {
			o = new FileOutputStream("F:\\叶飞io测试\\hello.txt");
			String s = "我爱你中国";
			byte[] b = s.getBytes();
			o.write(b, 0, b.length);
			System.out.println("文件已更新！");
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				o.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}

}
